package com.code.design.model.demo.factory.simplefactorypattern;

/**
 * 口罩工厂用来创建不同类型的口罩
 *
 * @author tangyifei
 */
public class MaskFactory {
    
    public IMask createMask(String type) {
        IMask mask = null;
        if ("高端口罩".equals(type)) {
            mask = new HighEndMask();
            // .....
            // HighEndMask的100行初始化代码
        } else if ("低端口罩".equals(type)) {
            mask = new LowEndMask();
            // .....
            // LowEndMask的100行初始化代码
        }
        return mask;
    }
}
